.class public Lrexsee/keyboard/KeyboardParameters;
.super Ljava/lang/Object;
.source "KeyboardParameters.java"


# static fields
.field public static final DEFAULT_KEYBOARD_STYLE:Ljava/lang/String; = "width:wrapcontent;width:wrapcontent;border-width:0px;background-color:transparent;align:center;vertical-align:bottom;"

.field public static final DEFAULT_KEY_STYLE_NORMAL:Ljava/lang/String; = "icon-alpha:0.5;width:fillparent;height:wrapcontent;weight:1;label-visibility:hidden;icon-visibility:visible;icon-width:56px;icon-height:56px;icon-scale:fitxy;border-width:0px;background-color:transparent;"

.field public static final DEFAULT_KEY_STYLE_PRESSED:Ljava/lang/String; = "icon-alpha:1;"

.field public static final DEFAULT_ROW_STYLE:Ljava/lang/String; = "width:fillparent;height:wrapcontent;weight:0;border-width:0;background-color:transparent;"

.field public static final KEYCODE_CANCEL:I = -0x5

.field public static final KEYCODE_HELP:I = -0x2

.field public static final KEYCODE_HOME:I = -0x4

.field public static final KEYCODE_QA:I = -0x3

.field public static final KEYCODE_REXSEE:I = -0x1


# instance fields
.field public final keyRowStyle:Ljava/lang/String;

.field public final keyStyleNormal:Ljava/lang/String;

.field public final keyStylePressed:Ljava/lang/String;

.field public final keyStyleSelected:Ljava/lang/String;

.field public final keyTheme:Ljava/lang/String;

.field public final keyboardStyle:Ljava/lang/String;

.field public final keys:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Ljava/util/ArrayList",
            "<",
            "Ljava/lang/Integer;",
            ">;>;"
        }
    .end annotation
.end field

.field public final mCallback:Z


# direct methods
.method public constructor <init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)V
    .locals 2
    .param p1, "keysString"    # Ljava/lang/String;
    .param p2, "theme"    # Ljava/lang/String;
    .param p3, "boardStyle"    # Ljava/lang/String;
    .param p4, "rowStyle"    # Ljava/lang/String;
    .param p5, "normalStyle"    # Ljava/lang/String;
    .param p6, "pressedStyle"    # Ljava/lang/String;
    .param p7, "callback"    # Z

    .prologue
    .line 37
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 34
    const-string v0, ""

    iput-object v0, p0, Lrexsee/keyboard/KeyboardParameters;->keyStyleSelected:Ljava/lang/String;

    .line 38
    invoke-direct {p0, p1}, Lrexsee/keyboard/KeyboardParameters;->getKeys(Ljava/lang/String;)Ljava/util/ArrayList;

    move-result-object v0

    iput-object v0, p0, Lrexsee/keyboard/KeyboardParameters;->keys:Ljava/util/ArrayList;

    .line 39
    iput-object p2, p0, Lrexsee/keyboard/KeyboardParameters;->keyTheme:Ljava/lang/String;

    .line 40
    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "width:wrapcontent;width:wrapcontent;border-width:0px;background-color:transparent;align:center;vertical-align:bottom;"

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lrexsee/keyboard/KeyboardParameters;->keyboardStyle:Ljava/lang/String;

    .line 41
    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "width:fillparent;height:wrapcontent;weight:0;border-width:0;background-color:transparent;"

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0, p4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lrexsee/keyboard/KeyboardParameters;->keyRowStyle:Ljava/lang/String;

    .line 42
    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "icon-alpha:0.5;width:fillparent;height:wrapcontent;weight:1;label-visibility:hidden;icon-visibility:visible;icon-width:56px;icon-height:56px;icon-scale:fitxy;border-width:0px;background-color:transparent;"

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0, p5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lrexsee/keyboard/KeyboardParameters;->keyStyleNormal:Ljava/lang/String;

    .line 43
    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "icon-alpha:1;"

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0, p6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lrexsee/keyboard/KeyboardParameters;->keyStylePressed:Ljava/lang/String;

    .line 44
    iput-boolean p7, p0, Lrexsee/keyboard/KeyboardParameters;->mCallback:Z

    .line 45
    return-void
.end method

.method private getIconDrawable(Lrexsee/core/browser/Browser;Ljava/lang/String;IZ)Landroid/graphics/drawable/Drawable;
    .locals 2
    .param p1, "browser"    # Lrexsee/core/browser/Browser;
    .param p2, "theme"    # Ljava/lang/String;
    .param p3, "keyCode"    # I
    .param p4, "pressed"    # Z

    .prologue
    .line 99
    iget-object v0, p1, Lrexsee/core/browser/Browser;->urlListeners:Lrexsee/core/browser/RexseeUrl;

    invoke-virtual {v0, p2}, Lrexsee/core/browser/RexseeUrl;->getAbsoluteUrl(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p2

    .line 100
    if-eqz p4, :cond_0

    new-instance v0, Ljava/lang/StringBuilder;

    invoke-static {p2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v1, "/pressed"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p2

    .line 101
    :cond_0
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-static {p2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v1, "/"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, ".png"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p2

    .line 102
    const/4 v0, 0x0

    invoke-static {p1, p2, v0}, Lrexsee/core/style/RexseeDrawable;->getDrawable(Lrexsee/core/browser/Browser;Ljava/lang/String;Landroid/graphics/drawable/Drawable;)Landroid/graphics/drawable/Drawable;

    move-result-object v0

    return-object v0
.end method

.method private getKeys(Ljava/lang/String;)Ljava/util/ArrayList;
    .locals 10
    .param p1, "keys"    # Ljava/lang/String;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            ")",
            "Ljava/util/ArrayList",
            "<",
            "Ljava/util/ArrayList",
            "<",
            "Ljava/lang/Integer;",
            ">;>;"
        }
    .end annotation

    .prologue
    const-string v9, ""

    .line 82
    if-eqz p1, :cond_0

    invoke-virtual {p1}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v6

    const-string v7, ""

    invoke-virtual {v6, v9}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v6

    if-eqz v6, :cond_1

    :cond_0
    const/4 v6, 0x0

    .line 95
    :goto_0
    return-object v6

    .line 83
    :cond_1
    new-instance v5, Ljava/util/ArrayList;

    invoke-direct {v5}, Ljava/util/ArrayList;-><init>()V

    .line 84
    .local v5, "rtn":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Ljava/util/ArrayList<Ljava/lang/Integer;>;>;"
    const-string v6, "\\;"

    invoke-virtual {p1, v6}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v4

    .line 85
    .local v4, "line":[Ljava/lang/String;
    const/4 v1, 0x0

    .local v1, "i":I
    :goto_1
    array-length v6, v4

    if-lt v1, v6, :cond_2

    move-object v6, v5

    .line 95
    goto :goto_0

    .line 86
    :cond_2
    aget-object v6, v4, v1

    invoke-virtual {v6}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v6

    const-string v7, ""

    invoke-virtual {v6, v9}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v6

    if-nez v6, :cond_3

    aget-object v6, v4, v1

    const-string v7, ","

    const-string v8, ""

    invoke-virtual {v6, v7, v9}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v6

    const-string v7, ""

    invoke-virtual {v6, v9}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v6

    if-eqz v6, :cond_4

    .line 85
    :cond_3
    :goto_2
    add-int/lit8 v1, v1, 0x1

    goto :goto_1

    .line 87
    :cond_4
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    .line 88
    .local v0, "a":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Ljava/lang/Integer;>;"
    aget-object v6, v4, v1

    const-string v7, "\\,"

    invoke-virtual {v6, v7}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v3

    .line 89
    .local v3, "k":[Ljava/lang/String;
    const/4 v2, 0x0

    .local v2, "j":I
    :goto_3
    array-length v6, v3

    if-lt v2, v6, :cond_5

    .line 93
    invoke-virtual {v5, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    goto :goto_2

    .line 90
    :cond_5
    aget-object v6, v3, v2

    invoke-virtual {v6}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v6

    const-string v7, ""

    invoke-virtual {v6, v9}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v6

    if-eqz v6, :cond_6

    .line 89
    :goto_4
    add-int/lit8 v2, v2, 0x1

    goto :goto_3

    .line 91
    :cond_6
    aget-object v6, v3, v2

    const/16 v7, -0x2710

    invoke-static {v6, v7}, Lrexsee/core/utilities/Utilities;->getInt(Ljava/lang/String;I)I

    move-result v6

    invoke-static {v6}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v6

    invoke-virtual {v0, v6}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    goto :goto_4
.end method


# virtual methods
.method public getMenus(Lrexsee/core/browser/Browser;)Ljava/util/ArrayList;
    .locals 14
    .param p1, "browser"    # Lrexsee/core/browser/Browser;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lrexsee/core/browser/Browser;",
            ")",
            "Ljava/util/ArrayList",
            "<",
            "Lrexsee/core/menu/PopMenu;",
            ">;"
        }
    .end annotation

    .prologue
    .line 48
    iget-object v1, p0, Lrexsee/keyboard/KeyboardParameters;->keys:Ljava/util/ArrayList;

    if-eqz v1, :cond_0

    iget-object v1, p0, Lrexsee/keyboard/KeyboardParameters;->keys:Ljava/util/ArrayList;

    invoke-virtual {v1}, Ljava/util/ArrayList;->size()I

    move-result v1

    if-nez v1, :cond_1

    :cond_0
    const/4 v1, 0x0

    .line 79
    :goto_0
    return-object v1

    .line 49
    :cond_1
    new-instance v13, Ljava/util/ArrayList;

    invoke-direct {v13}, Ljava/util/ArrayList;-><init>()V

    .line 50
    .local v13, "menus":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lrexsee/core/menu/PopMenu;>;"
    const/4 v8, 0x0

    .local v8, "i":I
    :goto_1
    iget-object v1, p0, Lrexsee/keyboard/KeyboardParameters;->keys:Ljava/util/ArrayList;

    invoke-virtual {v1}, Ljava/util/ArrayList;->size()I

    move-result v1

    if-lt v8, v1, :cond_2

    move-object v1, v13

    .line 79
    goto :goto_0

    .line 51
    :cond_2
    iget-object v1, p0, Lrexsee/keyboard/KeyboardParameters;->keys:Ljava/util/ArrayList;

    invoke-virtual {v1, v8}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v11

    check-cast v11, Ljava/util/ArrayList;

    .line 52
    .local v11, "line":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Ljava/lang/Integer;>;"
    new-instance v12, Lrexsee/core/menu/PopMenu;

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "Line"

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, v8}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    iget-object v2, p0, Lrexsee/keyboard/KeyboardParameters;->keyRowStyle:Ljava/lang/String;

    invoke-direct {v12, p1, v1, v2}, Lrexsee/core/menu/PopMenu;-><init>(Lrexsee/core/browser/Browser;Ljava/lang/String;Ljava/lang/String;)V

    .line 53
    .local v12, "menu":Lrexsee/core/menu/PopMenu;
    const/4 v9, 0x0

    .local v9, "j":I
    :goto_2
    invoke-virtual {v11}, Ljava/util/ArrayList;->size()I

    move-result v1

    if-lt v9, v1, :cond_3

    .line 77
    invoke-virtual {v13, v12}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 50
    add-int/lit8 v8, v8, 0x1

    goto :goto_1

    .line 54
    :cond_3
    invoke-virtual {v11, v9}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Integer;

    invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I

    move-result v10

    .line 55
    .local v10, "keycode":I
    new-instance v3, Lrexsee/keyboard/KeyboardParameters$1;

    invoke-direct {v3, p0, v10, p1}, Lrexsee/keyboard/KeyboardParameters$1;-><init>(Lrexsee/keyboard/KeyboardParameters;ILrexsee/core/browser/Browser;)V

    .line 62
    .local v3, "downRunnable":Ljava/lang/Runnable;
    new-instance v4, Lrexsee/keyboard/KeyboardParameters$2;

    invoke-direct {v4, p0, v10, p1}, Lrexsee/keyboard/KeyboardParameters$2;-><init>(Lrexsee/keyboard/KeyboardParameters;ILrexsee/core/browser/Browser;)V

    .line 69
    .local v4, "upRunnable":Ljava/lang/Runnable;
    new-instance v0, Lrexsee/core/menu/PopMenuItem;

    invoke-virtual {p1}, Lrexsee/core/browser/Browser;->getContext()Landroid/content/Context;

    move-result-object v1

    new-instance v2, Ljava/lang/StringBuilder;

    const-string v5, "Item"

    invoke-direct {v2, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2, v8}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v5, "_"

    invoke-virtual {v2, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, v9}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    iget-object v5, p0, Lrexsee/keyboard/KeyboardParameters;->keyStyleNormal:Ljava/lang/String;

    iget-object v6, p0, Lrexsee/keyboard/KeyboardParameters;->keyStylePressed:Ljava/lang/String;

    iget-object v7, p0, Lrexsee/keyboard/KeyboardParameters;->keyStylePressed:Ljava/lang/String;

    invoke-direct/range {v0 .. v7}, Lrexsee/core/menu/PopMenuItem;-><init>(Landroid/content/Context;Ljava/lang/String;Ljava/lang/Runnable;Ljava/lang/Runnable;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    .line 70
    .local v0, "item":Lrexsee/core/menu/PopMenuItem;
    iget-object v1, v0, Lrexsee/core/menu/PopMenuItem;->styleNormal:Lrexsee/core/style/StyleSheet;

    iget-object v2, p0, Lrexsee/keyboard/KeyboardParameters;->keyTheme:Ljava/lang/String;

    const/4 v3, 0x0

    invoke-direct {p0, p1, v2, v10, v3}, Lrexsee/keyboard/KeyboardParameters;->getIconDrawable(Lrexsee/core/browser/Browser;Ljava/lang/String;IZ)Landroid/graphics/drawable/Drawable;

    .end local v3    # "downRunnable":Ljava/lang/Runnable;
    move-result-object v2

    iput-object v2, v1, Lrexsee/core/style/StyleSheet;->icon:Landroid/graphics/drawable/Drawable;

    .line 71
    iget-object v1, v0, Lrexsee/core/menu/PopMenuItem;->styleNormal:Lrexsee/core/style/StyleSheet;

    iget-object v1, v1, Lrexsee/core/style/StyleSheet;->icon:Landroid/graphics/drawable/Drawable;

    if-nez v1, :cond_4

    iget-object v1, v0, Lrexsee/core/menu/PopMenuItem;->styleNormal:Lrexsee/core/style/StyleSheet;

    new-instance v2, Landroid/graphics/drawable/ColorDrawable;

    const/4 v3, 0x0

    invoke-direct {v2, v3}, Landroid/graphics/drawable/ColorDrawable;-><init>(I)V

    iput-object v2, v1, Lrexsee/core/style/StyleSheet;->icon:Landroid/graphics/drawable/Drawable;

    .line 72
    :cond_4
    iget-object v1, v0, Lrexsee/core/menu/PopMenuItem;->stylePressed:Lrexsee/core/style/StyleSheet;

    iget-object v2, p0, Lrexsee/keyboard/KeyboardParameters;->keyTheme:Ljava/lang/String;

    const/4 v3, 0x1

    invoke-direct {p0, p1, v2, v10, v3}, Lrexsee/keyboard/KeyboardParameters;->getIconDrawable(Lrexsee/core/browser/Browser;Ljava/lang/String;IZ)Landroid/graphics/drawable/Drawable;

    move-result-object v2

    iput-object v2, v1, Lrexsee/core/style/StyleSheet;->icon:Landroid/graphics/drawable/Drawable;

    .line 73
    iget-object v1, v0, Lrexsee/core/menu/PopMenuItem;->stylePressed:Lrexsee/core/style/StyleSheet;

    iget-object v1, v1, Lrexsee/core/style/StyleSheet;->icon:Landroid/graphics/drawable/Drawable;

    if-nez v1, :cond_5

    iget-object v1, v0, Lrexsee/core/menu/PopMenuItem;->stylePressed:Lrexsee/core/style/StyleSheet;

    iget-object v2, v0, Lrexsee/core/menu/PopMenuItem;->styleNormal:Lrexsee/core/style/StyleSheet;

    iget-object v2, v2, Lrexsee/core/style/StyleSheet;->icon:Landroid/graphics/drawable/Drawable;

    iput-object v2, v1, Lrexsee/core/style/StyleSheet;->icon:Landroid/graphics/drawable/Drawable;

    .line 74
    :cond_5
    invoke-virtual {v12, v0}, Lrexsee/core/menu/PopMenu;->add(Lrexsee/core/menu/PopMenuItem;)V

    .line 53
    add-int/lit8 v9, v9, 0x1

    goto/16 :goto_2
.end method
